home *** CD-ROM | disk | FTP | other *** search
- /*
- * MUBBS misc.c
- *
- * This program source code and it's compiled version is
- * Copyright (c) 1991 N. Hawthorn.
- * This program source code and it's compiled version IS NOT IN THE
- * PUBLIC DOMAIN ! Please read the "COPYRIGHT NOTICE / NH" file for details
- * regarding use of this program source code and it's compiled version.
- *
- *
- * Code to make your life eaiser !
- *
- */
-
-
- #include "MUBBS Module.h"
-
-
-
- /* These two routines change string formats from C to Pascal and back
-
- PtoCstr(tstring); where are these located ?? in C or Mac ????
- CtoPstr(tstring); this one returns a pointer ??
-
- */
-
- /* You can use these routines to switch things around if you want, they are */
- /* already written for you ! */
-
- /* we have to put prototypes here because we didn't compile these in this
- * file only
- */
-
-
- removespaces(temp)
- char *temp;
- {
- int len;
- len = strlen(temp) - 1; /* takes out trailing spaces */
- while ((temp[len] == '\x20') && (len > 0)){
- temp[len] = '\0';
- len--;
- }
- }
-
- pStrCopy( p2, p1 )
- char *p2, *p1;
- /* copies a pascal string from p1 to p2 */
- {
- int len;
-
- len = *p2++ = *p1++;
- while (--len>=0) *p2++=*p1++;
- }
-
-
- strtoupper(str1) /* makes a string all uppercase */
- char *str1;
- {
- int i = 0,l;
- l=strlen(str1);
- do {
- str1[i] = toupper(str1[i]);
- } while (++i < l);
- }
-
-
- strcatc(str,c) /* appends a character to a string */
- char *str,c;
- {
- char n[2];
- n[0]=c;
- n[1]=0;
- strcat(str,n) ;
- }
- /* end of function */
-
- strtolong(n,str)
- char *str;
- long *n;
- {
- sscanf(str,"%ld",&n) ;
- }
- /* end of function */
-
- longtostr(n,str)
- char *str;
- long n;
- {
- sprintf(str,"%ld",n) ;
- }
- /* end of function */
-
- strtoint(str)
- char *str;
- {
- int n=0;
- sscanf(str,"%d",&n) ;
- return(n);
- }
- /* end of function */
-
- inttostr(n,str)
- char *str;
- int n;
- {
- sprintf(str,"%d",n) ;
- }
- /* end of function */
-
- getdatetime(datetime)
- char *datetime;
- {
- gettime("%m/%d/%y %I:%M:%S %p",datetime); /* gets the date & time */
- }
-
-